package org.geektimes.projects.user.oauth2;

/**
* open authentication 过滤器  
* @author : KangNing Hu
*/
public class DefaultOAuth2Configuration implements OAuth2Configuration{


	/**
	 * originName
	 */
	private String originName;

	/**
	 * 授权url
	 */
	private String authorizeUrl;

	/**
	 *获取token url
	 */
	private String accessTokenUrl;


	/**
	 * jwt 密钥对url
	 */
	private String jwksUrl;


	/**
	 * 客户端id
	 */
	private String clientId;

	/**
	 * 密钥
	 */
	private String clientSecret;

	/**
	 * 认证成功回调地址
	 */
	private String callSucceedUrl;

	/**
	 * 认证失败的回调地址
	 */
	private String callFailureUrl;

	/**
	 * 授权范围
	 */
	private String scope;

	/**
	 * 参数配置
	 */
	private ParamConfiguration paramConfiguration = new ParamConfiguration();


	@Override
	public String getCallSucceedUrl() {
		return callSucceedUrl;
	}

	public void setCallSucceedUrl(String callSucceedUrl) {
		this.callSucceedUrl = callSucceedUrl;
	}

	@Override
	public String getCallFailureUrl() {
		return callFailureUrl;
	}

	@Override
	public String getScope() {
		return scope;
	}

	public void setCallFailureUrl(String callFailureUrl) {
		this.callFailureUrl = callFailureUrl;
	}

	@Override
	public String getOriginName() {
		return this.originName;
	}

	public String getAuthorizeUrl() {
		return authorizeUrl;
	}

	public void setAuthorizeUrl(String authorizeUrl) {
		this.authorizeUrl = authorizeUrl;
	}

	public String getAccessTokenUrl() {
		return accessTokenUrl;
	}

	public void setAccessTokenUrl(String accessTokenUrl) {
		this.accessTokenUrl = accessTokenUrl;
	}

	public String getJwksUrl() {
		return jwksUrl;
	}

	public void setJwksUrl(String jwksUrl) {
		this.jwksUrl = jwksUrl;
	}

	public String getClientId() {
		return clientId;
	}

	public void setClientId(String clientId) {
		this.clientId = clientId;
	}

	public String getClientSecret() {
		return clientSecret;
	}

	public void setScope(String scope) {
		this.scope = scope;
	}

	public void setOriginName(String originName) {
		this.originName = originName;
	}


	public void setClientSecret(String clientSecret) {
		this.clientSecret = clientSecret;
	}


	public ParamConfiguration getParamConfiguration() {
		return paramConfiguration;
	}

	public void setParamConfiguration(ParamConfiguration paramConfiguration) {
		this.paramConfiguration = paramConfiguration;
	}

	/**
	 * 参数配置
	 */
	public static class ParamConfiguration{

		/**
		 * 客户端id参数名称
		 */
		private String clientId = "client_id";


		/**
		 * 客户端密钥参数名称
		 */
		private String clientSecret = "client_secret";

		/**
		 * 重定向地址
		 */
		private String redirectUri = "redirect_uri";

		/**
		 * 授权方式
		 */
		private String responseType = "response_type";



		public String getClientId() {
			return clientId;
		}

		public void setClientId(String clientId) {
			this.clientId = clientId;
		}

		public String getClientSecret() {
			return clientSecret;
		}

		public void setClientSecret(String clientSecret) {
			this.clientSecret = clientSecret;
		}

		public String getRedirectUri() {
			return redirectUri;
		}

		public void setRedirectUri(String redirectUri) {
			this.redirectUri = redirectUri;
		}

		public String getResponseType() {
			return responseType;
		}

		public void setResponseType(String responseType) {
			this.responseType = responseType;
		}
	}




}
